package cn.dapeng.test;

import lombok.SneakyThrows;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.net.URL;
import java.util.Enumeration;

public class ReadClassPathFileContent {

    @SneakyThrows
    public static void main(String[] args) {
        Enumeration<URL> enumeration = ReadClassPathFileContent.class.getClassLoader().getResources("xx.txt");
        while (enumeration.hasMoreElements()) {
            URL url = enumeration.nextElement();

            File file = new File(url.getPath());

            BufferedReader reader = new BufferedReader(new FileReader(file));

            System.out.println(reader.readLine());
            System.out.println(url);
        }
    }

    public static int a(int a, int b) {
        return b == 0 ? a : a(b, a % b);


    }
}
